local skill = fk.CreateSkill{
  name = "death_grip_skill",
}

Fk:loadTranslationTable{
  [skill.name] = "死亡之握",
  ["#death_grip_skill"] = "选择一名其他角色，你观看其手牌并可以使用其中一张牌。",

  ["#death_grip_skill-choose"] = "死亡之握：可以使用一张牌",
}

skill:addEffect("cardskill", {
  prompt = "#death_grip_skill",
  can_use = Util.CanUse,
  target_num = 1,
  mod_target_filter = function (self, player, to_select, selected, card, extra_data)
    return player ~= to_select
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function (self, room, effect)
    if effect.to:isKongcheng() then return end
    local cards = effect.to:getCardIds("h")
    local available = table.filter(cards, function (id)
      return #Fk:getCardById(id):getDefaultTarget(effect.from, { bypass_times = true, bypass_distances = true }) > 0
    end)
    local use, _ = room:askToChooseCardsAndChoice(effect.from, {
      cards = available,
      skill_name = "death_grip",
      all_cards = cards,
      cancel_choices = {"Cancel"},
      choices = {"OK"},
      default_choice = "Cancel",
      max_num = 1,
      min_num = 1
    })
    if #use == 1 then
      room:askToUseRealCard(effect.from, {
        pattern = use,
        cancelable = false,
        skill_name = "death_grip",
        extra_data = { expand_pile = use }
      })
    end
  end
})

return skill